<?php
/**
 * Admin_AdminController
 * A abstract class for other admin class interhit
 * wrap logic for authenticate user
 * 
 * @author Tuan Ngo
 * @version 1.0
 */
class Admin_AdminController extends Zend_Controller_Action{
	
	public function init(){
		$this->view->controller =  $this->_request->getControllerName();
		$this->view->action =  $this->_request->getActionName();
		$this->view->module = $this->_request->getModuleName();
	}
	
	public function preDispatch(){
		Zend_Loader::loadClass("AuthModel");
		
		//code for authenticate
		$auth = new AuthModel();
		if(!$auth->isLoggedIn())
			$this->_redirect('/account/login');
	}
}